/*
 * @Descripttion:
 * @version: 1.0
 * @Author: wuhao
 * @Date: 2021-10-08 15:02:51
 * @LastEditors: wuhao
 * @LastEditTime: 2021-10-11 11:36:50
 */
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'

import iView from 'iview'
import 'iview/dist/styles/iview.css'
import './assets/css/ehb.css'
import './assets/css/common.css'

import EhbHeader from './components/common/EhbHeader'
import EhbContentRow from './components/common/EhbContentRow'
import EhbContentRow2 from './components/common/EhbContentRow2'
import EhbFooter from './components/common/EhbFooter'
import EstateHeader from './components/common/EstateHeader'
import EhbMultiProcess from './components/common/EhbMultiProcess'
import EhbCollapse from './components/common/EhbCollapse'
import EhbPanel from './components/common/EhbPanel'
import EhbInputClear from './components/common/EhbInputClear'

import Global from './config/Global'
import dictionary from './config/dictionary'
import axios from 'axios'
import VueJsonp from 'vue-jsonp'
import VConsole from 'vconsole'
import {
    plusXing,
    alertInfo,
    toNOData,
    defaultValue,
    copyDeep,
    isEmptyStr,
    uuid,
    IdentityCodeValid,
    saveLog,
    isMobile
} from "./utils/common";

absoultPath = Global.contextPath[Global.urlType] + '/#';
Vue.config.productionTip = false;
Vue.prototype.GLOBAL = Global;
Vue.prototype.Dictionary = dictionary;
Vue.prototype.$axios = axios;
Vue.prototype.$alertInfo = alertInfo;
Vue.use(VueJsonp)
Vue.use(iView);
Vue.component("EhbHeader", EhbHeader);
Vue.component("EhbContentRow", EhbContentRow);
Vue.component("EhbContentRow2", EhbContentRow2);
Vue.component("EhbFooter", EhbFooter);
Vue.component("EstateHeader", EstateHeader);
Vue.component("EhbMultiProcess", EhbMultiProcess);
Vue.component("EhbCollapse", EhbCollapse);
Vue.component("EhbPanel", EhbPanel);
Vue.component("EhbInputClear", EhbInputClear);

/* eslint-disable no-new */
const curEnv = process.env.NODE_ENV
let curEnvParam = require('./env/' + curEnv)
Vue.prototype.$globalEnv = {
    ...curEnvParam
};
//将全局变量模块挂载到 Vue.prototype 中
absoultPath = location.origin + "/#"
Vue.prototype.$absoultPath = absoultPath;

// 常用方法挂载到 Vue.prototype 中
Vue.prototype.toNOData = toNOData;
Vue.prototype.defaultValue = defaultValue;
Vue.prototype.copyDeep = copyDeep;
Vue.prototype.isEmptyStr = isEmptyStr;
Vue.prototype.uuid = uuid;
Vue.prototype.IdentityCodeValid = IdentityCodeValid;
Vue.prototype.saveLog = saveLog;
Vue.prototype.isMobile = isMobile;
Vue.prototype.plusXing = plusXing;

let vue = new Vue({
    router,
    store,
    render: h => h(App)
}).$mount("#app")

if (vue.$globalEnv.enableConsole) {
    new VConsole();
}
